home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 November: Tool Chest / Dev.CD Nov 00 TC Disk 2.toast / pc / sample code / quicktime / quicktime vr / vrscript / vrscript.h < prev    next >
Encoding:
Text File  |  2000-09-28  |  30.0 KB  |  610 lines

  1. //////////
  2. //
  3. //    File:        VRScript.h
  4. //
  5. //    Contains:    Header file for external script file processing.
  6. //
  7. //    Written by:    Tim Monroe
  8. //
  9. //    Copyright:    © 1997 by Apple Computer, Inc., all rights reserved.
  10. //
  11. //    Change History (most recent first):
  12. //
  13. //       <2>         04/17/97        rtm        revised structures slightly
  14. //       <1>         03/06/97        rtm        first file
  15. //       
  16. //////////
  17.  
  18. #pragma once
  19.  
  20.  
  21. //////////
  22. //
  23. // header files
  24. //       
  25. //////////
  26.  
  27. #include "ComApplication.h"
  28.  
  29. #if TARGET_OS_MAC
  30. #include "MacFramework.h"
  31. #endif
  32.  
  33. #if TARGET_OS_WIN32
  34. #include "WinFramework.h"
  35. #endif
  36.  
  37. #if !SOUNDSPROCKET_AVAIL
  38. typedef    long                SSpSourceReference;
  39. typedef    long                SSpListenerReference;
  40. #endif    
  41.  
  42. #include "VR3DTexture.h"
  43.  
  44.  
  45. //////////
  46. //
  47. // constants
  48. //       
  49. //////////
  50.  
  51. #define kDefaultScriptFileName    "myScript"    // default name of the script file
  52.  
  53. #define kDebugWindowTitle        "Debug"        // name of verbose mode debug window
  54.  
  55. #if !USE_SIOUX_FOR_DEBUG
  56. #define kDebugWindowTextSize    10            // the text size of the debug window        
  57. #define kDebugWindowLineSize    (kDebugWindowTextSize + 3)
  58. #endif
  59.  
  60. #define kUnknownCommandString    "WARNING: Previous command not recognized"
  61.  
  62. #define kMaxCmdLineLength        512            // maximum length, in bytes, of a command line
  63. #define kMaxCmdWordLength        32            // maximum length, in bytes, of a command word
  64. #define kMaxVarNameLength        32            // maximum length, in bytes, of a variable name
  65. #define kMaxVarOpLength            3            // maximum length, in bytes, of a variable operation
  66.  
  67. #if TARGET_OS_MAC
  68. #define kMaxFileNameLength        64            // maximum length, in bytes, of a file name
  69. #define kOffscreenPixelType        k32ARGBPixelFormat
  70. #endif
  71. #if TARGET_OS_WIN32
  72. #define kMaxFileNameLength        MAX_PATH    // maximum length, in bytes, of a file name
  73. #define kOffscreenPixelType        k32BGRAPixelFormat
  74. #endif
  75.  
  76. #define kRadianTolerance        0.001        // how close two floating-point radian values must be for us to count them equal
  77.  
  78. #define kMaxOSTypeLength        5            // maximum length, in bytes, of an OSType (plus terminating null character)
  79.  
  80. // values for fOptions field of sound or movie entry
  81. enum {
  82.     kVRMedia_PlayNew        = 0,            // start the media playing (whether it's already playing or not)
  83.     kVRMedia_Restart        = 1,            // stop the media if already playing, then start the media playing
  84.     kVRMedia_ToggleStop        = 2,            // toggle between play and stop/remove
  85.     kVRMedia_Continue        = 3,            // start the media playing if it's not playing, ignore otherwise
  86.     kVRMedia_Stop            = 4,            // stop the media playing
  87.     kVRMedia_TogglePause    = 5                // toggle between play and pause
  88. };
  89.  
  90. // values for fOptions field of localized sound entry, fMode field of other sound/movies entries
  91. // (palindrome looping is not supported for sounds, however)
  92. enum {
  93.     kVRPlay_Loop            = 0,
  94.     kVRPlay_Once            = 1,
  95.     kVRPlay_LoopPalindrome    = 2
  96. };
  97.  
  98. // values for fSoundContainer field of a sound entry
  99. enum {
  100.     kVRSound_SoundResource    = (UInt32)0,    // sound container is a sound resource (of type 'snd ')
  101.     kVRSound_AIFFFile        = (UInt32)1,    // sound container is an AIFF file
  102.     kVRSound_WAVEFile        = (UInt32)2,    // sound container is a WAVE file
  103.     kVRSound_URL            = (UInt32)3,    // sound container is a URL
  104.     kVRSound_SoundFile        = (UInt32)4        // sound container is a sound file (of type 'sfil' and creator 'movr');
  105.                                             // this is never used, since we just play the contained sound resource.
  106. };
  107.  
  108. // values for theOptions parameter of VRSound_DumpSelectedSounds and VRMoov_DumpSelectedSounds
  109. enum {
  110.     kVRSelect_Node            = 0,
  111.     kVRSelect_Scene            = 1
  112. };
  113.  
  114. // special values for fMaxExecutions field of command entries
  115. enum {
  116.     kVRDoIt_Forever            = -1
  117. };
  118.  
  119. // values for fOptions field of angle (and other) commands
  120. enum {
  121.     kVRValue_Absolute        = 0,
  122.     kVRValue_Relative        = 1
  123. };
  124.  
  125. // values for fOptions field of controller bar command (and for some state parameters)
  126. enum {
  127.     kVRState_Hide            = 0,
  128.     kVRState_Show            = 1,
  129.     kVRState_Toggle            = 2
  130. };
  131.  
  132. // values for fOptions field of timed commands
  133. enum {
  134.     kVROrphan_LetLive        = 0,
  135.     kVROrphan_Kill            = 1
  136. };
  137.  
  138. // values for Button parameter of SetButtonState command
  139. enum {
  140.     kVRButton_Step            = 0,            // QuickTime step buttons; not supported by VR controller
  141.     kVRButton_Speaker        = 1,            // speaker button
  142.     kVRButton_GoBack        = 2,            // go-back button
  143.     kVRButton_ZoomInOut        = 3,            // zoom buttons
  144.     kVRButton_ShowHotSpots    = 4,            // show hot spots button
  145.     kVRButton_Translate        = 5,            // translate button
  146.     kVRButton_HelpText        = 6,            // help text; not really a button, but same interface works
  147.     kVRButton_HotSpotNames    = 7,            // hot spot names; not really a button, but same interface works
  148.     kVRButton_Custom        = 8                // the custom button
  149. };
  150.  
  151. // values for fOptions field of PlayTransMovie command
  152. enum {
  153.     kVRMovie_PlayAll        = 0,
  154.     kVRMovie_PlayTilClick    = 1
  155. };
  156.  
  157. // values for Mode parameter of SetPanTiltZoom command
  158. enum {
  159.     kVRTransition_Jump        = 0,            // jump from current pan/tilt/fov to new values
  160.     kVRTransition_Swing        = 1,            // swing from current pan/tilt/fov to new values 
  161.     kVRTransition_SwingWait    = 2                // swing from current pan/tilt/fov to new values and wait until done
  162. };
  163.  
  164. // special values for fBoxHeight and fBoxWidth fields of picture overlay entry
  165. #define kVRUseMovieHeight    32000
  166. #define kVRUseMovieWidth    32000
  167.  
  168. // special values for NodeID parameter of many commands
  169. #define kVRAnyNode            (UInt32)-1
  170.  
  171. // bit flags for fPegSides field of picture overlay entry
  172. enum {
  173.     kPegSide_Left            = (1L << 0),
  174.     kPegSide_Top            = (1L << 1),
  175.     kPegSide_Right            = (1L << 2),
  176.     kPegSide_Bottom            = (1L << 3)
  177. };
  178.  
  179. // values for fMode field of timed command entry
  180. enum {
  181.     kVRUseAbsoluteTime        = 0,            // time is relative to application launch
  182.     kVRUseNodeTime            = 1,            // time is relative to node entry
  183.     kVRUseInstallTime        = 2                // time is relative to command installation
  184. };
  185.  
  186. // values for NameType parameter of some commands
  187. enum {
  188.     kVRAbsolutePath            = 0,            // path is absolute
  189.     kVRRelativePath            = 1,            // path is relative
  190.     kVRAbsoluteURL            = 2,            // URL is absolute
  191.     kVRRelativeURL            = 3                // URL is relative
  192. };
  193.  
  194. // resource IDs for undefined hot spots ('undf', other undefined, or missing type)
  195. #define kCursID_MouseOverUndefHS    -19687
  196. #define kCursID_MouseDownOnUndefHS    -19686
  197. #define kCursID_MouseUpOnUndefHS    -19685
  198.  
  199. // values for fEntryType field of any list entry
  200. // IMPORTANT: the values for implemented list types MUST be sequential!
  201. enum {
  202.     kVREntry_Generic            = 0,    // a generic list entry
  203.     kVREntry_Sound                = 1,    // a sound list entry
  204.     kVREntry_QTMovie            = 2,    // a QuickTime movie list entry
  205.     kVREntry_QD3DObject            = 3,    // a QuickDraw 3D object list entry
  206.     kVREntry_OverlayPicture        = 4,    // a picture overlay list entry
  207.     kVREntry_TimedCommand        = 5,    // a timed command list entry
  208.     kVREntry_QuitCommand        = 6,    // a quitting command list entry
  209.     kVREntry_MouseOverHS        = 7,    // a mouse-over hot spot command list entry
  210.     kVREntry_ClickHS            = 8,    // a click hot spot command list entry
  211.     kVREntry_ClickCustom        = 9,    // a click custom button command list entry
  212.     kVREntry_ClickSprite        = 10,    // a click sprite command list entry
  213.     kVREntry_NodeEntry            = 11,    // a node-entry command list entry
  214.     kVREntry_NodeExit            = 12,    // a node-exit command list entry
  215.     kVREntry_PanAngleCmd        = 13,    // a pan angle command list entry
  216.     kVREntry_TiltAngleCmd        = 14,    // a tilt angle command list entry
  217.     kVREntry_FOVAngleCmd        = 15,    // a zoom angle command list entry
  218.     kVREntry_Variable            = 16,    // a variable list entry
  219.     kVREntry_TransitionEffect    = 17,    // a QuickTime video effect transition list entry    
  220.     kVREntry_VRObjectMovie        = 18,    // a QuickTime VR object movie embedded in a panorama list entry    
  221.     kVREntry_EmbedPicture        = 19,    // a picture embedded in a panorama list entry
  222.     kVREntry_Unknown            = 100    // an unknown list entry
  223. };
  224.  
  225. #define kVRScript_FirstEntryType    kVREntry_Sound
  226. #define kVRScript_FinalEntryType    kVREntry_TransitionEffect
  227.  
  228.  
  229. //////////
  230. //
  231. // data structures
  232. //       
  233. //////////
  234.  
  235. // most of our script data is kept in a linked list of some appropriate type;
  236. // here are the various types:
  237.  
  238. // a generic list entry head
  239. typedef struct VRScriptGeneric {
  240.     UInt32                        fEntryType;            // kVREntry_Generic
  241.     UInt32                        fEntryID;            // a unique identifier for this entry
  242.     void                        *fNextEntry;        // the next entry in the list
  243.     UInt32                        fNodeID;            // the ID of the relevant node
  244.     UInt32                        fOptions;
  245.     SInt32                        fMaxExecutions;        // the maximum number of times command is executed
  246. } VRScriptGeneric, *VRScriptGenericPtr;
  247.  
  248.  
  249. // a list entry for our sound linked list
  250. // NOTE: this list contains only sounds for the current node or that are scene-wide (to be played in all nodes)
  251. typedef struct VRScriptSound {
  252.     UInt32                        fEntryType;            // kVREntry_Sound
  253.     UInt32                        fEntryID;            // a unique identifier for this entry
  254.     struct VRScriptSound        *fNextEntry;        // the next entry in the list
  255.     UInt32                        fNodeID;            // the node ID (either current node or kVRAnyNode)
  256.     UInt32                        fOptions;            // user interaction options
  257.     UInt32                        fMode;                // the loop mode (0 == loop; 1 == no loop)
  258.     UInt32                        fSoundContainer;    // the sound's container (resource? AIFF file? etc.)
  259.     UInt32                        fResID;                // the 'snd ' resource ID for the sound
  260.     SndListHandle                fResourceData;        // the 'snd ' resource data for the sound
  261.     short                        fRefNum;            // the file reference number, for file-based sounds
  262.     SndChannelPtr                fChannel;            // the sound channel
  263.     Boolean                        fSoundIsPlaying;    // is the sound (still) playing?
  264.     Boolean                        fFadeWhenStopping;    // should we fade sound out when we stop it?
  265.     Boolean                        fSoundIsLocalized;    // is the sound localized?
  266.     TQ3Point3D                    fLocation;            // the location of the sound
  267.     float                        fProjAngle;            // the angle within which the sound can be heard
  268.     SSpSourceReference            fSource;            // the sound source
  269. } VRScriptSound, *VRScriptSoundPtr;
  270.  
  271.  
  272. // a list entry for our 3D object linked list
  273. typedef struct VRScript3DObj {
  274.     UInt32                        fEntryType;            // kVREntry_QD3DObject
  275.     UInt32                        fEntryID;            // a unique identifier for this entry
  276.     struct VRScript3DObj        *fNextEntry;        // the next entry in the list
  277.     UInt32                        fNodeID;            // (unused here)    
  278.     UInt32                        fOptions;
  279.     TQ3GroupObject                fModel;                // the 3D object in the scene being modelled
  280.     TQ3StyleObject                fInterpolation;        // interpolation style used when rendering
  281.     TQ3StyleObject                fBackFacing;        // whether to draw shapes that face away from the camera
  282.     TQ3StyleObject                fFillStyle;            // whether drawn as solid filled object or decomposed to components
  283.     TQ3Matrix4x4                fRotation;            // the transform for the model
  284.     TQ3Vector3D                    fRotateFactors;        // the x, y, and z rotation factors
  285.     TQ3Point3D                    fGroupCenter;        // the center of the group
  286.     float                        fGroupScale;        // scaling factor to apply before drawing
  287.     TextureHdl                    fTexture;            // the texture for the 3D object
  288.     Boolean                        fTextureIsMovie;    // is the texture from a QuickTime movie?
  289.     Boolean                        fModelIsVisible;    // is the 3D object visible?
  290.     Boolean                        fModelIsAnimated;    // is the 3D object being animated?
  291. } VRScript3DObj, *VRScript3DObjPtr;
  292.  
  293.  
  294. // a list entry for our picture overlay linked list
  295. // NOTE: this list contains only pictures for the current node
  296. typedef struct VRScriptPicture {
  297.     UInt32                        fEntryType;            // kVREntry_OverlayPicture
  298.     UInt32                        fEntryID;            // a unique identifier for this entry
  299.     struct VRScriptPicture        *fNextEntry;        // the next entry in the list
  300.     UInt32                        fNodeID;            // (unused here)    
  301.     UInt32                        fOptions;
  302.     UInt32                        fResID;                // the 'PICT' resource ID for the picture
  303.     UInt32                        fBoxHeight;            // height of the display rectangle
  304.     UInt32                        fBoxWidth;            // width of the display rectangle
  305.     UInt32                        fPegSides;            // side(s) to which display rectangle is pegged
  306.     UInt32                        fOffset;            // offset of display rectangle from pegged side(s)
  307.     PicHandle                    fResourceData;        // the 'PICT' resource data for the picture
  308. } VRScriptPicture, *VRScriptPicturePtr;
  309.  
  310.  
  311. // a list entry for our time-based command linked list
  312. typedef struct VRScriptAtTime {
  313.     UInt32                        fEntryType;            // kVREntry_TimedCommand
  314.     UInt32                        fEntryID;            // a unique identifier for this entry
  315.     struct VRScriptAtTime        *fNextEntry;        // the next entry in the list
  316.     UInt32                        fNodeID;        
  317.     UInt32                        fOptions;
  318.     SInt32                        fMaxExecutions;        // the maximum number of times command is executed
  319.     UInt32                        fTime;
  320.     UInt32                        fMode;                // 0 == absolute time; 1 == node-relative time; 2 == install-relative
  321.     float                        fTimeInstalled;        // the time (in ticks) when entry installed
  322.     char                        *fCommandLine;
  323.     Boolean                        fRepeat;            // does this command repeat?
  324.     UInt32                        fPeriod;            // the interval (in ticks) of repeating
  325. } VRScriptAtTime, *VRScriptAtTimePtr;
  326.  
  327.  
  328. // a list entry for our quitting time command linked list
  329. typedef struct VRScriptAtQuit {
  330.     UInt32                        fEntryType;            // kVREntry_QuitCommand
  331.     UInt32                        fEntryID;            // a unique identifier for this entry
  332.     struct VRScriptAtQuit        *fNextEntry;        // the next entry in the list
  333.     UInt32                        fNodeID;            // (unused here)    
  334.     UInt32                        fOptions;
  335.     char                        *fCommandLine;
  336. } VRScriptAtQuit, *VRScriptAtQuitPtr;
  337.  
  338.  
  339. // a list entry for our mouse-over hot spot command linked list
  340. typedef struct VRScriptAtMOHS {
  341.     UInt32                        fEntryType;            // kVREntry_MouseOverHS
  342.     UInt32                        fEntryID;            // a unique identifier for this entry
  343.     struct VRScriptAtMOHS        *fNextEntry;        // the next entry in the list
  344.     UInt32                        fNodeID;        
  345.     UInt32                        fOptions;            // the hot spot action selector (see VRPWQTVR2.0, p.1-39)
  346.     SInt32                        fMaxExecutions;        // the maximum number of times command is executed
  347.     Boolean                        fSelectByID;        // do we want hot spots targeted by ID (true) or type (false)?
  348.     UInt32                        fHotSpotID;            // the target hot spot ID; must be 0 if fSelectByID == false
  349.     OSType                        fHotSpotType;        // the target hot spot type; must be 0 if fSelectByID == true
  350.     char                        *fCommandLine;
  351. } VRScriptAtMOHS, *VRScriptAtMOHSPtr;
  352.  
  353.  
  354. // a list entry for our hot spot click command linked list
  355. typedef struct VRScriptClickHS {
  356.     UInt32                        fEntryType;            // kVREntry_ClickHS
  357.     UInt32                        fEntryID;            // a unique identifier for this entry
  358.     struct VRScriptClickHS        *fNextEntry;        // the next entry in the list
  359.     UInt32                        fNodeID;        
  360.     UInt32                        fOptions;            // do we prevent a link hot spot from triggering?
  361.     SInt32                        fMaxExecutions;        // the maximum number of times command is executed
  362.     Boolean                        fSelectByID;        // do we want hot spots targeted by ID (true) or type (false)?
  363.     UInt32                        fHotSpotID;            // the target hot spot ID; must be 0 if fSelectByID == false
  364.     OSType                        fHotSpotType;        // the target hot spot type; must be 0 if fSelectByID == true
  365.     char                        *fCommandLine;
  366. } VRScriptClickHS, *VRScriptClickHSPtr;
  367.  
  368.  
  369. // a list entry for our custom button click command linked list
  370. typedef struct VRScriptClickCustom {
  371.     UInt32                        fEntryType;            // kVREntry_ClickCustom
  372.     UInt32                        fEntryID;            // a unique identifier for this entry
  373.     struct VRScriptClickCustom    *fNextEntry;        // the next entry in the list
  374.     UInt32                        fNodeID;        
  375.     UInt32                        fOptions;            // (unused here)
  376.     SInt32                        fMaxExecutions;        // the maximum number of times command is executed
  377.     char                        *fCommandLine;
  378. } VRScriptClickCustom, *VRScriptClickCustomPtr;
  379.  
  380.  
  381. // a list entry for our sprite click command linked list
  382. typedef struct VRScriptClickSprite {
  383.     UInt32                        fEntryType;            // kVREntry_ClickSprite
  384.     UInt32                        fEntryID;            // a unique identifier for this entry
  385.     struct VRScriptClickSprite    *fNextEntry;        // the next entry in the list
  386.     UInt32                        fNodeID;        
  387.     UInt32                        fOptions;            // the sprite's atom ID
  388.     SInt32                        fMaxExecutions;        // the maximum number of times command is executed
  389.     char                        *fCommandLine;
  390. } VRScriptClickSprite, *VRScriptClickSpritePtr;
  391.  
  392.  
  393. // a list entry for our node-entry command linked list
  394. typedef struct VRScriptNodeIn {
  395.     UInt32                        fEntryType;            // kVREntry_NodeEntry
  396.     UInt32                        fEntryID;            // a unique identifier for this entry
  397.     struct VRScriptNodeIn        *fNextEntry;        // the next entry in the list
  398.     UInt32                        fNodeID;        
  399.     UInt32                        fOptions;
  400.     SInt32                        fMaxExecutions;        // the maximum number of times command is executed
  401.     char                        *fCommandLine;
  402. } VRScriptNodeIn, *VRScriptNodeInPtr;
  403.  
  404.  
  405. // a list entry for our node-exit command linked list
  406. typedef struct VRScriptNodeOut {
  407.     UInt32                        fEntryType;            // kVREntry_NodeExit
  408.     UInt32                        fEntryID;            // a unique identifier for this entry
  409.     struct VRScriptNodeOut        *fNextEntry;        // the next entry in the list
  410.     UInt32                        fNodeID;            // (unused here)    
  411.     UInt32                        fOptions;            // 1 == cancel the node exiting; 0 == exit the node
  412.     SInt32                        fMaxExecutions;        // the maximum number of times command is executed
  413.     SInt32                        fFromNodeID;
  414.     SInt32                        fToNodeID;
  415.     char                        *fCommandLine;
  416. } VRScriptNodeOut, *VRScriptNodeOutPtr;
  417.  
  418.  
  419. // a list entry for our angle-based command linked list
  420. typedef struct VRScriptAtAngle {
  421.     UInt32                        fEntryType;            // kVREntry_PanAngleCmd, kVREntry_TiltAngleCmd, or kVREntry_FOVAngleCmd
  422.     UInt32                        fEntryID;            // a unique identifier for this entry
  423.     struct VRScriptAtAngle        *fNextEntry;        // the next entry in the list
  424.     UInt32                        fNodeID;    
  425.     UInt32                        fOptions;
  426.     SInt32                        fMaxExecutions;        // the maximum number of times command is executed
  427.     float                        fMinAngle;
  428.     float                        fMaxAngle;
  429.     char                        *fCommandLine;
  430. } VRScriptAtAngle, *VRScriptAtAnglePtr;
  431.  
  432.  
  433. // a list entry for our QuickTime movie linked list
  434. typedef struct VRScriptMovie {
  435.     UInt32                        fEntryType;            // kVREntry_QTMovie
  436.     UInt32                        fEntryID;            // a unique identifier for this entry
  437.     struct VRScriptMovie        *fNextEntry;        // the next entry in the list
  438.     UInt32                        fNodeID;            // the node ID (either current node or kVRAnyNode)
  439.     UInt32                        fOptions;            // user interaction options
  440.     UInt32                        fMode;                // loop or play once    
  441.     Movie                        fMovie;                // the embedded movie to play
  442.     GWorldPtr                    fOffscreenGWorld;    // the offscreen graphics world used for imaging embedded movies
  443.     PixMapHandle                fOffscreenPixMap;    // the pixmap of the offscreen graphics world
  444.     GWorldPtr                    fPrevBBufGWorld;    // the previous offscreen graphics world used for the back buffer
  445.     Rect                        fPrevBBufRect;        // the previous rectangle of the area of interest
  446.     QTVRFloatPoint                fMovieCenter;        // the center in the panorama of the movie screen (in angles: x = pan; y = tilt)
  447.     Rect                        fMovieBox;            // the movie box
  448.     float                        fMovieScale;        // a scale factor for the movie rectangle
  449.     float                        fMovieWidth;        // the width (in radians) of the embedded movie; if 0, movie has no video track
  450.     Boolean                        fUseOffscreenGWorld;// use an offscreen GWorld?
  451.     Boolean                        fUseMovieCenter;    // use the specified movie center?
  452.     Boolean                        fQTMovieHasSound;    // does the embedded movie have a sound track?
  453.     Boolean                        fQTMovieHasVideo;    // does the embedded movie have a video track?
  454.     Boolean                        fCompositeMovie;    // does the embedded movie need to be composited?
  455.     Boolean                        fUseHideRegion;        // use the specified movie hide region?
  456.     RGBColor                    fChromaColor;        // the color for chroma key compositing
  457.     RgnHandle                    fHideRegion;        // the region that obscures the embedded movie video track
  458.     MatrixRecord                fMovieMatrix;        // the matrix we use to (optionally) rotate the movie
  459.     MatrixRecord                fOrigMovieMatrix;    // the movie's original matrix
  460.     ImageDescriptionHandle        fImageDesc;            // image description for DecompressSequenceFrameS
  461.     ImageSequence                fImageSequence;        // image sequence for DecompressSequenceFrameS        
  462.     Boolean                        fSoundIsLocalized;    // is the movie sound localized?
  463.     Boolean                        fDoRotateMovie;        // should we rotate the movie?
  464.     float                        fVolAngle;            // the half angle of the movie attenuation cone
  465.     MediaHandler                fMediaHandler;        // the sound media handler
  466.     char                        *fPathname;
  467. } VRScriptMovie, *VRScriptMoviePtr;
  468.  
  469.  
  470. // a list entry for our variables linked list
  471. typedef struct VRScriptVariable {
  472.     UInt32                        fEntryType;            // kVREntry_Variable
  473.     UInt32                        fEntryID;            // (unused here)
  474.     struct VRScriptVariable        *fNextEntry;        // the next entry in the list
  475.     UInt32                        fNodeID;            // (unused here)
  476.     SInt32                        fValue;                // the value of the variable
  477.     SInt32                        fMaxExecutions;        // (unused here)
  478.     char                        *fVarName;            // the name of the variable
  479. } VRScriptVariable, *VRScriptVariablePtr;
  480.  
  481.  
  482. // a list entry for our QuickTime video effects transitions linked list
  483. typedef struct VRScriptTransition {
  484.     UInt32                        fEntryType;            // kVREntry_TransitionEffect
  485.     UInt32                        fEntryID;            // (unused here)
  486.     struct VRScriptTransition    *fNextEntry;        // the next entry in the list
  487.     UInt32                        fNodeID;            // (unused here)
  488.     UInt32                        fOptions;            //
  489.     SInt32                        fMaxExecutions;        // the maximum number of times transition is executed
  490.     UInt32                        fFromNodeID;
  491.     UInt32                        fToNodeID;
  492.     OSType                        fEffectType;        // the type of the effect
  493.     long                        fEffectNum;            // the number of the effect
  494.     QTAtomContainer                fEffectDesc;        // the effect description for the effect
  495.     ImageDescriptionHandle        fSampleDesc;        // the sample description for the effect
  496.     TimeBase                    fTimeBase;            // time base for the effect
  497.     TimeValue                    fTimeValue;            // time value for the effect
  498.     ImageSequence                fSequenceID;        // sequence ID for the effect
  499.     long                        fNumberOfSteps;        // number of steps in the effect
  500. } VRScriptTransition, *VRScriptTransitionPtr;
  501.  
  502.  
  503. // a list entry for our embedded picture linked list
  504. typedef struct VRScriptEmbPict {
  505.     UInt32                        fEntryType;            // kVREntry_EmbedPicture
  506.     UInt32                        fEntryID;            // a unique identifier for this entry
  507.     struct VRScriptEmbPict        *fNextEntry;        // the next entry in the list
  508.     UInt32                        fNodeID;        
  509.     UInt32                        fOptions;            // user interaction options
  510.     QTVRFloatPoint                fCenter;            // the center in the panorama of the picture screen (in angles: x = pan; y = tilt)
  511.     Rect                        fRect;                // the height and width of the embedded picture (in coordinates)
  512.     float                        fScale;                // a scale factor for the picture rectangle
  513.     float                        fWidth;                // the width (in radians) of the embedded picture; if 0, movie has no video track
  514.     Boolean                        fUseMovieGWorld;    // use the specified picture GWorld?
  515.     Boolean                        fCompositeMovie;    // does the embedded picture need to be composited?
  516.     Boolean                        fUseHideRegion;        // use the specified picture hide region?
  517.     RGBColor                    fChromaColor;        // the color for chroma key compositing
  518.     RgnHandle                    fHideRegion;        // the region that obscures the embedded picture
  519.     char                        *fPathname;
  520. } VRScriptEmbPict, *VRScriptEmbPictPtr;
  521.  
  522.  
  523. // a list entry for our embedded QuickTime VR object movie linked list
  524. typedef struct VRScriptVRObject {
  525.     UInt32                        fEntryType;            // kVREntry_VRObjectMovie
  526.     UInt32                        fEntryID;            // a unique identifier for this entry
  527.     struct VRScriptEmbPict        *fNextEntry;        // the next entry in the list
  528.     UInt32                        fNodeID;        
  529.     UInt32                        fOptions;            // user interaction options
  530.     QTVRFloatPoint                fCenter;            // the center in the panorama of the object
  531.     Rect                        fRect;                // the height and width of the embedded picture (in coordinates)
  532.     float                        fScale;                // a scale factor for the picture rectangle
  533.     float                        fWidth;                // the width (in radians) of the embedded picture; if 0, movie has no video track
  534.     Boolean                        fUseMovieGWorld;    // use the specified picture GWorld?
  535.     Boolean                        fCompositeMovie;    // does the embedded picture need to be composited?
  536.     Boolean                        fUseHideRegion;        // use the specified picture hide region?
  537.     RGBColor                    fChromaColor;        // the color for chroma key compositing
  538.     RgnHandle                    fHideRegion;        // the region that obscures the embedded picture
  539.     char                        *fPathname;
  540. } VRScriptVRObject, *VRScriptVRObjectPtr;
  541.  
  542.  
  543. //////////
  544. //
  545. // function prototypes
  546. //       
  547. //////////
  548.  
  549. void                VRScript_OpenScriptFile (WindowObject theWindowObject, char *theFileName);
  550. #if TARGET_OS_WIN32
  551. void                VRScript_OpenCommandLineScriptFile (LPSTR theCmdLine);
  552. #endif
  553. void                VRScript_FindAndOpenQTVRMovieFile (FSSpec *theFSSpecPtr);
  554. void                VRScript_ProcessScriptCommandLine (WindowObject theWindowObject, char *theCommand);
  555. WindowPtr            VRScript_OpenDebugWindow (void);
  556. void                VRScript_PrintToDebugWindow (char *theString);
  557. void                VRScript_SetCurrentDirectory (FSSpecPtr theFSSpecPtr);
  558. void                VRScript_SetCurrentMovie (WindowObject theWindowObject, UInt32 theOverlayType, UInt32 theNameType, UInt32 theOptions, char *thePathName);
  559. void                VRScript_SetControllerBarState (WindowObject theWindowObject, Boolean theState, UInt32 theOptions);
  560. void                VRScript_SetControllerButtonState (WindowObject theWindowObject, UInt32 theButton, Boolean theState, UInt32 theOptions);
  561. void                VRScript_SetResizeState (WindowObject theWindowObject, Boolean theState, UInt32 theOptions);
  562. void                VRScript_SetAngleConstraints (WindowObject theWindowObject, UInt16 theKind, float theMinAngle, float theMaxAngle, UInt32 theOptions);
  563. short                VRScript_OpenResourceFile (WindowObject theWindowObject, UInt32 theOptions, char *thePathName);
  564. VRScriptSoundPtr    VRScript_EnlistSound (WindowObject theWindowObject, UInt32 theNodeID, UInt32 theResID, UInt32 theEntryID, UInt32 theMode, UInt32 theFade, UInt32 theOptions, SndChannelPtr theChannel, SndListHandle theResource);
  565. VRScriptSoundPtr    VRScript_EnlistLocalizedSound (WindowObject theWindowObject, UInt32 theNodeID, UInt32 theResID, UInt32 theEntryID, float theX, float theY, float theZ, float theProjAngle, UInt32 theMode, UInt32 theFade, UInt32 theOptions, SndChannelPtr theChannel, SndListHandle theResource, SSpSourceReference theSource);
  566. VRScriptMoviePtr    VRScript_EnlistMovie (WindowObject theWindowObject, UInt32 theNodeID, UInt32 theEntryID, float thePanAngle, float theTiltAngle, float theScale, float theWidth, UInt32 theKeyRed, UInt32 theKeyGreen, UInt32 theKeyBlue, Boolean theUseBuffer, Boolean theUseCenter, Boolean theUseKey, Boolean theUseHide, Boolean theUseDir, Boolean theRotate, float theVolAngle, UInt32 theMode, UInt32 theOptions, char *thePathName);
  567. void                VRScript_Enlist3DObject (WindowObject theWindowObject, TQ3GroupObject theGroup, UInt32 theEntryID, float theX, float theY, float theZ, UInt32 theOptions);
  568. VRScriptPicturePtr    VRScript_EnlistOverlayPicture (WindowObject theWindowObject, UInt32 theResID, UInt32 theEntryID, UInt32 theHeight, UInt32 theWidth, UInt32 thePegSides, UInt32 theOffset, PicHandle theResource, UInt32 theOptions);
  569. void                VRScript_EnlistTimedCommand (WindowObject theWindowObject, UInt32 theTicks, UInt32 theMode, UInt32 theNodeID, UInt32 theRepeat, UInt32 thePeriod, SInt32 theMaxTimes, UInt32 theOptions, char *theCmdLine);
  570. void                VRScript_EnlistQuitCommand (WindowObject theWindowObject, UInt32 theOptions, char *theCmdLine);
  571. void                VRScript_EnlistMouseOverHSCommand (WindowObject theWindowObject, UInt32 theNodeID, UInt32 theHotSpotID, OSType theHotSpotType, SInt32 theMaxTimes, UInt32 theOptions, char *theCmdLine);
  572. void                VRScript_EnlistClickHSCommand (WindowObject theWindowObject, UInt32 theNodeID, UInt32 theHotSpotID, OSType theHotSpotType, SInt32 theMaxTimes, UInt32 theOptions, char *theCmdLine);
  573. void                VRScript_EnlistClickCustomButtonCommand (WindowObject theWindowObject, UInt32 theNodeID, SInt32 theMaxTimes, UInt32 theOptions, char *theCmdLine);
  574. void                VRScript_EnlistClickSpriteCommand (WindowObject theWindowObject, UInt32 theNodeID, SInt32 theMaxTimes, UInt32 theOptions, char *theCmdLine);
  575. void                VRScript_EnlistNodeEntryCommand (WindowObject theWindowObject, UInt32 theNodeID, SInt32 theMaxTimes, UInt32 theOptions, char *theCmdLine);
  576. void                VRScript_EnlistNodeExitCommand (WindowObject theWindowObject, UInt32 theFromNodeID, UInt32 theToNodeID, SInt32 theMaxTimes, UInt32 theOptions, char *theCmdLine);
  577. void                VRScript_EnlistAngleCommand (WindowObject theWindowObject, UInt32 theKind, UInt32 theNodeID, float theMinAngle, float theMaxAngle, SInt32 theMaxTimes, UInt32 theOptions, char *theCmdLine);
  578. void                VRScript_EnlistVariable (WindowObject theWindowObject, char *theVarName, UInt32 theVarValue);
  579. void                VRScript_EnlistTransitionEffect (WindowObject theWindowObject, UInt32 theFromNodeID, UInt32 theToNodeID, SInt32 theMaxTimes, OSType theEffectType, long theEffectNum, UInt32 theOptions);
  580. void                VRScript_DelistEntry (WindowObject theWindowObject, VRScriptGenericPtr theEntryPtr);
  581. void                VRScript_DeleteListOfType (WindowObject theWindowObject, UInt32 theEntryType);
  582. void                VRScript_DeleteAllLists (WindowObject theWindowObject);
  583. VRScriptGenericPtr    VRScript_GetObjectByEntryID (WindowObject theWindowObject, UInt32 theEntryType, UInt32 theEntryID);
  584. VRScriptVariablePtr    VRScript_GetVariableEntry (WindowObject theWindowObject, char *theVarName);
  585. void                VRScript_InstallHotSpotInterceptProc (QTVRInstance theInstance, WindowObject theWindowObject);
  586. void                VRScript_InstallPrescreenRoutine (QTVRInstance theInstance, WindowObject theWindowObject);
  587. void                VRScript_InstallBackBufferImagingProc (QTVRInstance theInstance, WindowObject theWindowObject);
  588. void                VRScript_InstallInterceptRoutine (QTVRInstance theInstance, WindowObject theWindowObject);
  589. void                VRScript_InstallMouseOverHotSpotProc (QTVRInstance theInstance, WindowObject theWindowObject);
  590. PASCAL_RTN void        VRScript_HotSpotInterceptProc (QTVRInstance theInstance, QTVRInterceptPtr theMsg, WindowObject theWindowObject, Boolean *theCancel);
  591. PASCAL_RTN OSErr    VRScript_PrescreenRoutine (QTVRInstance theInstance, WindowObject theWindowObject);
  592. PASCAL_RTN OSErr    VRScript_BackBufferImagingProc (QTVRInstance theInstance, Rect *theRect, UInt16 theAreaIndex, UInt32 theFlagsIn, UInt32 *theFlagsOut, WindowObject theWindowObject);
  593. PASCAL_RTN void        VRScript_InterceptRoutine (QTVRInstance theInstance, QTVRInterceptPtr theMsg, WindowObject theWindowObject, Boolean *cancel);
  594. PASCAL_RTN OSErr    VRScript_EnteringNodeProc (QTVRInstance theInstance, UInt32 theNodeID, WindowObject theWindowObject);
  595. PASCAL_RTN OSErr    VRScript_LeavingNodeProc (QTVRInstance theInstance, UInt32 fromNodeID, UInt32 toNodeID, Boolean *theCancel, WindowObject theWindowObject);
  596. PASCAL_RTN OSErr    VRScript_MouseOverHotSpotProc (QTVRInstance theInstance, UInt32 theHotSpotID, UInt32 theFlags, WindowObject theWindowObject);
  597. PASCAL_RTN void        VRScript_MoviePrePrerollCompleteProc (Movie theMovie, OSErr thePrerollErr, void *theRefcon);
  598. void                VRScript_CheckForTimedCommands (WindowObject theWindowObject);
  599. void                VRScript_CheckForClickCustomButtonCommands (WindowObject theWindowObject, EventRecord *theEvent);
  600. Boolean                VRScript_CheckForClickSpriteCommands (WindowObject theWindowObject, EventRecord *theEvent);
  601. void                VRScript_CheckForAngleCommands (WindowObject theWindowObject);
  602. void                VRScript_CheckForExpiredCommand (WindowObject theWindowObject, VRScriptGenericPtr thePointer);
  603. void                VRScript_DumpUnexpiredCommands (WindowObject theWindowObject, UInt32 theNodeID);
  604. void                VRScript_PackString (char *theString);
  605. void                VRScript_UnpackString (char *theString);
  606. void                VRScript_DecodeString (char *theString);
  607. OSType                VRScript_StringToOSType (char *theString);
  608. char *                VRScript_OSTypeToString (OSType theType);
  609. Boolean                VRScript_FloatsAreEqual (float theFloat1, float theFloat2, float theTolerance);
  610.